<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        .box {
            width: 1000px;
            overflow: hidden;
            margin: 0 auto;
        }

        .box ul {
            width: 300px;
            float: left;
            margin: 0 10px;
        }

        .box li {
            width: 296px;
            border: 1px solid #111;
            margin: 10px 0;
        }
    </style>
</head>

<body>
    <div class="box">
        <ul></ul>
        <ul></ul>
        <ul></ul>
    </div>
</body>

</html>
<script>
    
    const box = document.querySelector('.box')
    const ous = box.children;
    console.log(ous);

    function addli() {
        let lis = document.createElement('li')
        lis.style.height = parseInt(Math.random() * 300 + 150) + 'px';
        let min;
        let ul1 = ous[0].offsetHeight;
        let ul2 = ous[1].offsetHeight;
        let ul3 = ous[2].offsetHeight;
        if (ul1 < ul2) {    
            if (ul1 < ul3) {
                min = ous[0];
            } else {
                min = ous[2];
            }
        } else {
            if (ul2 < ul3) {
                min = ous[1];
            } else {
                min = ous[2];
            }
        }

        let i = Math.min(ul3 ,ul1 , ul2) ;   
 


        min.appendChild(lis);
    }
    for (let i = 0; i < 16; i++) {
        addli()
    }
    window.onscroll = function () {
        let wtop = document.documentElement.scrollTop;
        let kh = document.documentElement.clientHeight;
        let bh = document.documentElement.scrollHeight;
        // 判断快要到达底部  
        if (wtop >= bh - kh - 100) {
            for (let i = 0; i < 16; i++) {
                addli()
            }
        }
    }
</script>